/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.time.LocalDate;

/**
 * <p>Project: jse2302 - Switch1
 * <p>Powered by webrx On 2023-06-12 14:09:55
 * <p>Created by IntelliJ IDEA
 *
 * @author  webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Switch2 {
    public static void main(String[] args) {
        int year = 2023;
        //byte short int
        int month = 6;
        int days = 31;
        switch (month) {
            case 2:
                //days = LocalDate.of(year, month, 1).isLeapYear() ? 29 : 28;
                days = 28;
                break;
            case 4:
            case 6:
            case 9:
            case 11:
                days = 30;
                break;
        }
        System.out.printf("%d年%d月有(\033[31m%d\033[0m)天%n", year, month, days);

    }
}
